Improve readability of count validation in lazy-response-ads - #1228
Improve readability of count validation in lazy-response-ads#1228pavankumar-vh wants to merge 1 commit into
Conversation
The original code used a ternary inside Math.min/Math.max which was hard to read. Extracted the Number.isFinite check into a separate variable for clarity. This is a pure refactor with no behavioral change - the logic is identical.
|
Thanks for the contribution, but this doesn't change behavior at all — it's a pure stylistic rewrite of the same ternary/min/max logic, just moved into two lines instead of one. The original Maintainers generally won't port a change like this by hand into the private tree because the cost of reviewing/porting exceeds the value of the change - the code is functionally identical before and after. If you want to contribute to Closing as this is style-only churn with no substantive improvement. |
Overview
Improve code readability by extracting a complex ternary expression into a separate variable.
Change
The original code had a nested ternary inside Math.min/Math.max:
This was hard to read. Extracted the validation into a separate variable:
Testing
All existing tests pass (5/5).
Files Changed
common/src/util/lazy-response-ads.ts- Refactored count validationScope
This change only touches
common/which is an approved contribution area per the Contributing Guide.